0779e2f59da6698dd898232cf58538e435d92eea,src/algorithm/recursion/PrintTreeBoundaries.java,PrintTreeBoundaries,printRightInRev,#BinaryTree#,19
Before Change
private static void printRightInRev(BinaryTree<Integer> root) {
while (root != null) {
root = root.getRight();
System.out.println(root.getValue());
}
}
After Change
private static void printRightInRev(BinaryTree<Integer> root) {
if (root != null) {
// Not a leaf node.
if (!(root.getLeft() == null && root.getRight() == null)) {
printRightInRev(root.getRight());
System.out.println(root.getValue());
}